//
//  HMCreateFamilyVC.m
//  HMSdkDemo
//
//  Created by orvibo on 2017/11/28.
//  Copyright © 2017年 orvibo. All rights reserved.
//

#import "HMCreateFamilyVC.h"

@interface HMCreateFamilyVC ()
@property (nonatomic,strong)IBOutlet UITextField *textField;
@end

@implementation HMCreateFamilyVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
}

- (IBAction)createFamily {
    
    
    if (!_textField.text.length) {
        
        
        //[HMPopAlert popAlertWithMessage:@"请输入有效名称" inVc:self];
        return;
    }
    
    [HMFaimilyAPI createFamilyWithName:_textField.text loading:NO insert:NO completion:^(KReturnValue returnValue, id object) {
        if (returnValue == KReturnValueSuccess) {
            
            [self.navigationController popViewControllerAnimated:YES];
            
        }else if(returnValue == KReturnValueHasReachMaxNum){
            
            DLog(@"家庭数据量超过最大数量限制");
            
        }else{
            DLog(@"创建失败，错误码：%d",returnValue);
        }
    }];
}


@end
